<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ include file ="../include/base.jsp"%>
<!DOCTYPE HTML>
<html lang="en-US">
<head>
	<meta charset="UTF-8">
	<link rel="stylesheet" type="text/css"  href="<%=basePath %>css/bootstrap.min.css"/>
	<link rel="stylesheet" type="text/css"  href="<%=basePath %>css/task.css"/>
	<link rel="stylesheet" type="text/css" href="<%=basePath %>css/datepicker.css" />
	<title>凯胜项目管理系统</title>
	<style type="text/css">
		body{
			padding-top:50px;
		}
		.mywell{
			margin-top:25px;
		}
	</style>
</head>
<body class="body">
	
	<%@ include file = "../include/sametop.jsp" %>
	<div class="container">
		<div class="row">
		<jsp:include page="../include/sameleft.jsp">
			<jsp:param value="task" name="tag"/>
		</jsp:include>
			<div class="span9"  style="margin-bottom:0px;border-radius: 3px 3px 0 0;margin-top:10px">
				
				 <ul class="breadcrumb" style="margin-bottom:0px;border-radius: 3px 3px 0 0;margin-top:15px">
					<li class="active" style="margin-top:5px"><i class="icon-th"></i>我的所有日程</a></li>
					<li style="float:right;margin-top:0px">
						<div  style="float:right;border-radius: 8px 8px 8px 8px;">搜索：
							<select style="border-radius: 8px 8px 8px 8px;width:160px;height:25px">
									<option>请输入关键字</option>	
							  </select>
						</div>
					</li>
				</ul>
				<div class="wall " style="margin-bottom:0px;border-radius: 3px 3px 0 0;margin-top:0px;border:1px  solid #dddddd;min-height:500px;">
					<div class="row" style="margin-top:0px;margin-left:30px">						 
						 	<div style="margin-top:20px;margin-left:10px">
						 		<c:forEach items = "${list }" var = "task">
						 			<h4 class = "${task.dataType } mydataType" style = "margin-bottom:5px;margin-top:8px;">${task.dataType }</h4>
									<div style = "width:300px" class = "taskaboutdeal">
										<span  id = "${task.id}" class = "myspan" style="margin-left:-40px;display:none"><a href="javaScript:;" class = "deltaskaboutdeal" id = "${task.id}"><i class = "icon-trash"></i></a><span id="${task.dataType }" class="${task.content }"><a id = "${task.taskType.typeContent }" href="javaScript:;" class = "myeditlink">编辑</a></span></span>
										<span><span style = "margin-right:10px" id="num"><input id = "${task.id}" type="checkbox" style = "margin-left:5px" class = "mycheck"/></span><span  style = "color:#fff;height:15px;background-color:${task.taskType.color};margin-right:5px"><font>${task.taskType.typeContent }</font></span><span>${task.content }<c:if test="${task.contact!=null}">[来自：<a href="javaScript:;">${task.contact.name }]</a></c:if><c:if test="${not empty task.deal}">[来自：<a href="<%=basePath%>deal/singledeal.action?id=${task.deal.id}">${task.deal.name }<img  class = "myref" src="<%=basePath%>img/2.png"/></a>]</c:if></span></span>
										
									</div>
						 		
						 		
						 		
						 		</c:forEach>
								
					</div>				
				</div> 								
			</div> 
	
	</div>
	
	</div>
	<div class = "" id="mymodal2" style="width:300px;position:absolute;left:600px;top:140px;display:none;border:1px solid #ccc;border-radius:5px 5px;background-color:#fff;" >
							<div class = "modal-header">
										<input type="button" value="x" style = 'color:black' class = "close" data-dismiss = "modal"/>
										<h3>编辑日程</h3>
							</div>
							<form method="post" id="myfrom">
							<div class = "" style = "margin-left:20px">
								<strong>日程内容</strong><br/>
								<input type="text"  id="taskcontent" name="taskname"/><br/>
								<strong>时间安排</strong><br/>
							 	<input type = "text" style ="display:none;" id = "settimeinput2" name="settimeinput"/>
								<select id = "dateType" style = "width:150px" name="selecttime">
												
												<option class = "option" value="today">今天</option>
												<option  class = "option" value="tomorrow">明天</option>
												<option  class = "option" value="thisweek">这周</option>
												<option  class = "option" value="nextweek">下周</option>
												<option  class = "option" value="later">更晚</option>
												
											
									
								</select><a href="javaScript:;" id = "settimebtn2" class = "ui-datepicker-trigger">设置时间</a><br/>
								
								 <strong>选择类别</strong><br/>
								<select style = "width:150px" id = "leibie" name="taskType"> 
												<option value="none" class = "option1" value="none">none</option>
												<c:forEach items="${taskTypeList}" var ="taskType">
													<option class = "option1" value="${taskType.id}">${taskType.typeContent }</option>
												</c:forEach>
												<option value=""><a href="javaScript:;" id="new">新建一个</a></option>
												
								</select><span><a href = "<%=basePath1%>task/taskType.action">编辑类别</a></span><br/>
								
							</div>
							<hr>
							<div style = "margin-left:160px;margin-bottom:10px;">
								<input  id = "newtodelFiles" class = "btn btn-primary" value = "修改" type="submit"/>
								<a href="" class = "btn" id="quxiao" >取消</a>
							</div>
							</form>
						</div>		
	<script type="text/javascript" src="http://lib.sinaapp.com/js/jquery/1.7.2/jquery.min.js"></script>
	
	<script type="text/javascript" src="<%=basePath %>js/jquery.js"></script>
	<script type="text/javascript" src="<%=basePath %>js/task.js"></script>
	<script type="text/javascript" src ="<%=basePath %>js/bootstrap-datepicker.js"></script>
	<script type="text/javascript" src = "<%=basePath %>js/bootstrap.min.js"></script>
	<script type="text/javascript" src ="<%=basePath %>js/bootstrap-datepicker.js"></script>
	<script type="text/javascript">
		$(document).ready(function(){
			$(".tomorrow:not(:first)").remove();
			$(".today:not(:first)").remove();
			$(".thisweek:not(:first)").remove();
			$(".nextweek:not(:first)").remove();
			$(".later:not(:first)").remove();
			$(".overdue:not(:first)").remove();
			$(".taskaboutdeal").mousemove(function(){
				$(this).children(".myspan").show();
				
				
			});
			$(".taskaboutdeal").mouseout(function(){
				$(this).children(".myspan").hide();
				
				
			});
			$(".deltaskaboutdeal").live("click",function(){
			var id = $(this).attr("id");
			$.get("<%=basePath%>task/deltask.action?id="+id,function(data){
			});
			$(this).parent().parent().css("background-color","yellow");
			$(this).parent().parent().fadeOut(1500);
		
		
		
		
		
		});
		$(".mycheck").click(function(){
			var v =$(this).attr("checked");
			var id = $(this).attr("id");
			$.get("<%=basePath%>task/deltask.action?id="+id,function(data){
			});
			$(this).parent().parent().css("text-decoration","line-through");
			$(this).parent().parent().fadeOut(1500);
			
			
			
		
		
		});
		$(".myeditlink").live("click",function(){
			var dataType = $(this).parent().attr("id");
			var content = $(this).parent().attr("class");
			var taskType = $(this).attr("id");
			var id = $(this).parent().parent().attr("id");
			$("#myfrom").attr("action","<%=basePath%>task/editTask.action?id="+id);
			$(".option").each(function(){
				
				var c = $(this).attr("value");
				if(c==dataType){
					$(this).attr("selected","selected");
				}
			});
			$(".option1").each(function(){
				var v = $(this).html();
				if(v==taskType){
					$(this).attr("selected","selected");
				}
			});
			$("#taskcontent").attr("value",content);
			
			$("#mymodal2").show();
		
		});
		
		$(".close").click(function(){
			$("#mymodal2").hide();
		
		});
		$("#quxiao").click(function(){
			$("#mymodal2").hide();
		
		});
		$("#settimebtn2").click(function(){
			$("#settimeinput2").show();
			$("#dateType").hide();
		
		
		});
		$('#settimebtn2').datepicker().on('changeDate',function(ev){
				$("#settimeinput2").attr("value",$('#settimebtn2').data('date'));
			});
		
		});
		
		
	</script>
</body>
</html>
